<?php
    $int_Total = ceil($count / $page_size);
    if($int_Total < $show_count){
        $show_count = $int_Total;
    }
    $int_Middle = ceil($show_count * .5);
    if($page < $int_Middle){
        $int_First = 1;
    }else if($page > $int_Total - $int_Middle){
        $int_First = $int_Total - $show_count + 1;
    }else{
        $int_First = $page - $int_Middle + 1;
    }
    $int_Last = min($int_First + $show_count - 1,$int_Total);

?>
<div class="btn-group pull-right _pager" data-path="{{ $path }}">
    <button type="button" class="btn btn-white" onclick="pager.goPage(this,1)"><i class="fa fa-chevron-left"></i></button>
    @for($i=$int_First;$i<$int_Last+1;$i++)
        <button class="btn btn-white @if($page == $i) active" @else" onclick="pager.goPage(this,{{ $i }})" @endif>{{ $i }}</button>
    @endfor

    <button type="button" class="btn btn-white"onclick="pager.goPage(this,{{ $int_Total }})"><i class="fa fa-chevron-right"></i></button>
</div>